﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class RoomNumberBLL
    {
        public RoomNumberDAL RoomNumberDAL { get; }

        public RoomNumberBLL(RoomNumberDAL roomNumberDAL)
        {
            RoomNumberDAL = roomNumberDAL;
        }

        /// <summary>
        /// 添加房号
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int RoomNumberAdd(RoomNumberModel info)
        {
            try
            {
              return RoomNumberDAL.RoomNumberAdd(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 房号显示分页
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="totalPage"></param>
        /// <param name="Pageindex"></param>
        /// <param name="Pagesize"></param>
        /// <returns></returns>
        public IQueryable GetRoomNumberList(out int totalCount, out int totalPage, int Pageindex = 1, int Pagesize = 2)
        {
            try
            {
                return RoomNumberDAL.GetRoomNumberList(out totalCount, out totalPage, Pageindex, Pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 房号Id查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public RoomNumberModel RoomNumberId(int id)
        {
            try
            {
                return RoomNumberDAL.RoomNumberId(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int RoomNumberDel(int id)
        {
            try
            {
               return RoomNumberDAL.RoomNumberDel(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 房型修改
        /// </summary>
        /// <param name="roomType"></param>
        /// <returns></returns>
        public int RoomNumberUpdate(RoomNumberModel info)
        {
            try
            {
                return RoomNumberDAL.RoomNumberUpdate(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int RoomNumberDelAll(string ids)
        {
            try
            {
               return RoomNumberDAL.RoomNumberDelAll(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量上架下架
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public int RoomNumberUptAll(string ids, int state)
        {
            try
            {
                return RoomNumberDAL.RoomNumberUptAll(ids, state);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
